package com.ziyear.service.impl;

import com.ziyear.dao.TrainSeatDao;
import com.ziyear.dao.impl.TrainSeatDaoImpl;
import com.ziyear.service.TrainSeatService;

import java.sql.SQLException;

public class TrainSeatServiceImpl implements TrainSeatService {
    TrainSeatDao trainSeatDao = new TrainSeatDaoImpl();


    @Override
    public int freed(Integer seatId) {
        try {
            return trainSeatDao.freed(seatId);
        } catch (SQLException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }

    @Override
    public int occupySeat(Integer seatId) {
        try {
            return trainSeatDao.occupySeat(seatId);
        } catch (SQLException e) {
            e.printStackTrace();
            throw new RuntimeException(e);
        }
    }
}
